﻿using MSDAL;
using System.Linq;
using System.Web.Mvc;
using PagedList;

namespace MSWeb.Controllers
{
    public class ErrorsController : Controller
    {
        private readonly MSEntities _db = new MSEntities();
        
        public ActionResult Index(int? page)
        {
            var pageSize = 10;
            var pageNumber = (page ?? 1);
            return View(_db.Log
                .OrderBy(i => i.Date)
                .ToPagedList(pageNumber, pageSize));
        }
    }
}